<html>
<head><meta charset="utf-8"><title>Pretty printing ast · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Pretty.20printing.20ast.html">Pretty printing ast</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="208978935"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Pretty%20printing%20ast/near/208978935" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BN <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Pretty.20printing.20ast.html#208978935">(Sep 03 2020 at 14:49)</a>:</h4>
<p>Is there a way to pretty print ast::Crate or ast::Item instances or is Debug the only way to print them?</p>



<a name="208980717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Pretty%20printing%20ast/near/208980717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mukund Lakshman <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Pretty.20printing.20ast.html#208980717">(Sep 03 2020 at 15:02)</a>:</h4>
<p>(Maybe someone will have a more specific suggestion but generally speaking you can pretty-print <code>Debug</code> stuff using <code>{:#?}</code>.)</p>



<a name="208981511"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Pretty%20printing%20ast/near/208981511" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Pretty.20printing.20ast.html#208981511">(Sep 03 2020 at 15:07)</a>:</h4>
<p>AST nodes also implement <code>Display</code></p>



<a name="208981575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Pretty%20printing%20ast/near/208981575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Pretty.20printing.20ast.html#208981575">(Sep 03 2020 at 15:07)</a>:</h4>
<p>Ah, nevermind, I thought this was in #t-compiler/wg-rls-2.0</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>